{
 "cells": [
  {
   "cell_type": "raw",
   "metadata": {
    "raw_mimetype": "text/restructuredtext"
   },
   "source": [
    ".. _nb_truss2d:"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Truss2D\n",
    "\n",
    "The problem was proposed in <cite data-cite=\"truss2d\"></cite> for the purpose of investigating rules on Pareto-front."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pymoo.problems import get_problem\n",
    "from pymoo.visualization.scatter import Scatter\n",
    "\n",
    "pf = get_problem(\"truss2d\").pareto_front()\n",
    "\n",
    "sc = Scatter(title=\"Pareto-front\")\n",
    "sc.add(pf, s=80, facecolors='none', edgecolors='r')\n",
    "sc.add(pf, plot_type=\"line\", color=\"black\", linewidth=2)\n",
    "sc.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "sc.reset()\n",
    "sc.do()\n",
    "sc.apply(lambda ax: ax.set_yscale(\"log\"))\n",
    "sc.apply(lambda ax: ax.set_xscale(\"log\"))\n",
    "sc.show()"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
